package com.ms.banner.transformer;

import com.ms.banner.util.NumberUtil;
import ohos.agp.components.Component;

public class ScaleInOutTransformer extends ABaseTransformer {
    @Override
    protected void onTransform(Component component, float position) {
        component.setPivotX((float) (position < (float) 0 ? 0 : component.getWidth()));
        component.setPivotY((float) component.getHeight() / 2.0F);
        float scale = position < (float) 0 ? NumberUtil.plus(1.0F, position) : NumberUtil.sub(1.0F, position);
        component.setScaleX(scale);
        component.setScaleY(scale);
    }
}
